package com.itheima.day05;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.function.Consumer;

public class Demo1 {
    public static void main(String[] args) {
        ArrayList<String> lists = new ArrayList<>();
        lists.add("赵敏");
        lists.add("小昭");
        lists.add("素素");
        lists.add("灭绝");

        Iterator<String> iterator = lists.iterator();
        while (iterator.hasNext()) {
            String next = iterator.next();
            System.out.println("next = " + next);
        }

        
        lists.forEach(s -> System.out.println(s));
    }
}
